package com.liqi.monitor.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author: lgh
 * @Date: 2022-10-27
 * @Description:
 */
@Data
@ApiModel(value = "更新计划dto")
public class UpdatePlanDto implements Serializable {

    @ApiModelProperty(value = "消息编码，后台生成的一个流水号",required = false,hidden = true)
    private String messageCode;

    @ApiModelProperty(value = "1开机、2关机、3重启、4截图、5远程拉取日志、6远程自检、7下发更新计划",required = false,hidden = true)
    private Integer commandType;

    @ApiModelProperty(value = "后台需要planId 前端不用管",hidden = true)
    private String planId;
    /**
     * 设备唯一id
     */
    @ApiModelProperty(value = "设备唯一id",required = true)
    @NotBlank(message = "设备id 不能为空")
    private String deviceId;

    /**
     * 设备IP地址
     */
//    @ApiModelProperty(value = "设备IP地址")
//    @NotBlank(message = "设备IP地址 不能为空")
//    private String IpAddres;

    @ApiModelProperty(value = "执行时间")
    @Future(message = "执行时间必须>现在时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date executionTime;

    @ApiModelProperty(value = "驱动与sdk",required = true)
    @Valid
    private List<DriveAndSdkDto> updateList;

}
